Repository navigation
feat: init and update keep pharn/.run/ and pharn/.backup/ out of git (0.16.0) - #330
Merged
Merged
Conversation
…(0.16.0) pharn init and pharn update now append pharn/.run/ (pharn-oss's runtime scratch) and pharn/.backup/ (pharn's backups) to the project's root .gitignore, creating it when absent. An installed project used to track pharn/.run/, so pharn-oss's reconcile counted PHARN's own run state as build escapes (pharn-oss #408). Append-only: the old bytes stay the prefix, only missing entries are added in the file's own line endings, equivalent spellings and negations are respected, and a second run writes nothing. A symlinked or unusable .gitignore is never written; the run warns instead. A missing entry re-opens update's same-version early return. Dry runs preview it, and the --json reports gain an additive gitignore key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re-run-state Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Git strips a leading BOM from .gitignore, so an entry on the first line of a BOM file is already in force; pharn now reads it the same way instead of appending a redundant duplicate. Detection only: the file's bytes are never changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
🛡️ pharn-ci · ✅ PassTip Pass · Diff coverage of this change is 99.12% against a threshold of 80%; 20 agent setup files found.
🧪 Diff coverage99.12% of changed lines covered (112/113, threshold 80%) Changed files (10)
🔍 Test integrityNo test-integrity findings (mode: block). 🤖 Agent setup (20 files)Agent setup: 20 files · claude-code Agent setup files (20)
pharn-ci 0.2.0 · report schema v2 · coverage format lcov |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pharn initandpharn updatenow make sure the project's root.gitignorecoverspharn/.run/(pharn-oss's runtime scratch: stage logs, gate outputs, cost markers) andpharn/.backup/(pharn's update backups). Release 0.16.0.Why: installed projects did not ignore
pharn/.run/, so run state became tracked. In pharn-oss#408, 55 run-state files were counted as build escapes by reconcile and failed a correct build's verify. pharn-oss 7.2.0 fixed its side; this is the installer's side.This reverses the documented rule "pharn never edits
.gitignore" — for these two lines only. The README and theinit/update/add/remove/uninstalldocs and the CHANGELOG say so.add,removeanduninstallstill never write.gitignore.Behaviour
.gitignoreis created. An existing one gets only the missing line(s) plus one comment. Its existing bytes are always the unchanged prefix: never reordered or rewritten, CRLF stays CRLF, and a missing final newline gets a separator first./pharn/.run,pharn/.run,pharn/.run/*,pharn/.run/**,**/pharn/.run/, a bare.run/), including after a UTF-8 BOM. A negation the user wrote (!pharn/.run/) is respected..gitignoreis never written: the run warns and names the lines to add. A failed write is a warning, never a failed install.update. A missing line re-opens the "Already up to date" return, so existing installs get the lines on their nextupdate(bounded: the next run returns early again).--dry-runpreviews the change.init --dry-run --json/update --dry-run --jsongain an additivegitignore/plan.gitignorekey, present only when.gitignorewould change (schemaVersionstays 1).init --yes:.gitignoreis not one of its write targets, soinit --yesnever refuses because of it.pharn/.backup/is neither covered nor about to be added.Tests
tests/gitignore.test.ts(61): coversgit check-ignore.init --yesthenupdate --yes, CRLF, idempotent, re-open after a deleted line).npm run check,test:coverage(also withCI=1) andbuildare green.🤖 Generated with Claude Code